package com.lanou3g.ptp.taskrole.mapper;

import com.lanou3g.ptp.entity.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface TaskRoleMapper {

    List<TaskRole> findAll();

    TaskRole findById(Long id);

    void insertAll(List<TaskRole> taskRoles);

    void insert(TaskRole taskRole);

    void update(@Param("id") Long id, @Param("t") TaskRole taskRole);

    void delete(Long id);

    void deletes(Long[] ids);

    void deleteByTaskId(Long taskId);

    TaskRole findByRoleId(Long roleId);

    ArrayList<TaskRole> findByTaskId(Long taskId);

    void deletesByTaskIds(Long[] ids);


    Double selectTasks(@Param("taskId") Long taskId, @Param("getGradeItemId") Long getGradeItemId);

    Long addGage(@Param("grade") Grade insertGrade);

    int addGarageRole(@Param("gradeRole") GradeRole gradeRole);

    Long selectStudent(@Param("studentId") Long studentId, @Param("taskId") Long taskId);

    List<GradeRole> selectScores(@Param("id") Long id);

    List<GradeRole> addBoolean(@Param("role") Integer role, @Param("grade") long grade);

    List<TaskRole> proportion(@Param("tskId") long tskId, @Param("roleId") long roleId);

    void updateScore(@Param("id") Long gradeId, @Param("score") int score);

    List<Task> findTaskByStudentId(Long id);

    GradeTeacher findByStudentIdAndTaskId(@Param("studentId") Long studentId,
                                          @Param("taskId") Long taskId);

    Task findTask(Long taskId);

}
